package server;
import java.net.UnknownHostException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class SocketClient {
	public static void main(String[] args) throws UnknownHostException, IOException {
		Socket socket = new Socket("127.0.0.1",5209);	
		System.out.println("客户端启动");
		
		socket.getOutputStream();	//要从客户端发出去，所以输出
		PrintWriter writer = new PrintWriter(socket.getOutputStream());
		writer.println("abc");
		writer.flush();				//清空缓冲，将缓存推到流的对象
		
		BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
		System.out.println(in.readLine());
		
		writer.close();				//关闭流
		
		
	}
	
}	
